#include"connect.hpp"

using namespace std;

int main()
{
    //打开管道
    int fd = open(FIFO_FILE,O_WRONLY);
    if(fd < 0)
    {
        perror("open fail");
        exit(FIFO_OPEN_ERR);
    }
    //进行通信
    string line;
    while(1)
    {
        cout<<"please enter what:";
        getline(cin,line);
        write(fd,line.c_str(),sizeof(line));
    }
    //关闭管道
    close(fd);
}